package com.orhon.smartcampus.modules.base.mm;

import com.orhon.smartcampus.modules.base.entity.SchooltypesDeleateable;
import com.orhon.smartcampus.modules.base.gqlModel.GQLDictionary;
import com.orhon.smartcampus.modules.base.gqlModel.GQLRegion;
import com.orhon.smartcampus.modules.base.gqlModel.GQLSchoolType;

import org.mapstruct.*;
import org.mapstruct.factory.Mappers;

@Mapper(
    uses = {
        LangMapper.class,
        DictionaryMapper.class,
        RegionMapper.class
    }
)
public interface SchoolTypeMapper {

    SchoolTypeMapper MAPPER = Mappers.getMapper(SchoolTypeMapper.class);


    @Mapping(source = "id" , target = "id")
    @Mapping(source = "slug" , target = "slug")
    @Mapping(source = "orders" , target = "order")
    @Mapping(source = "mark" , target = "mark")
    @Mapping(source = "createdAt" , target = "created_at")
    @Mapping(source = "updatedAt" , target = "updated_at")
    @Mapping(source = "deletedAt" , target = "deleted_at")
    @Mapping(source = "name" , target = "name")//lang
    @Mapping(source = "period" , target = "period")//lang   
    GQLSchoolType fromEntity(SchooltypesDeleateable entity);



    @Named("province")
    default GQLRegion convertProvice(Integer pid){
        return new GQLRegion();
    }


    @Named("dictionary")
    default GQLDictionary convertDictionary(Integer pid){
        return new GQLDictionary();
    }



}
